package cn.gson.crm.model.pojo;

import java.io.Serializable;
import javax.persistence.*;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.List;


/**
 * The persistent class for the "FUNCTION" database table.
 * 
 */
@Entity
@Table(name="FUNCTION")
@NamedQuery(name="Function.findAll", query="SELECT f FROM Function f")
public class Function implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@SequenceGenerator(name="FUNCTION_FID_GENERATOR", sequenceName="SEQ_FUNCTION")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="FUNCTION_FID_GENERATOR")
	@Column(name="F_ID")
	private long fId;

	@Column(name="F_DESCRIBE")
	private String fDescribe;

	@Column(name="F_NAME")
	private String fName;

	//bi-directional many-to-many association to Role
	@ManyToMany(mappedBy="functions")
	@JSONField(serialize=false)
	private List<Role> roles;

	public Function() {
	}

	public long getFId() {
		return this.fId;
	}

	public void setFId(long fId) {
		this.fId = fId;
	}

	public String getFDescribe() {
		return this.fDescribe;
	}

	public void setFDescribe(String fDescribe) {
		this.fDescribe = fDescribe;
	}

	public String getFName() {
		return this.fName;
	}

	public void setFName(String fName) {
		this.fName = fName;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}